package com.example.esredisrabbitmqdemo.message;


import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @BelongsProject: es-redis-rabbitmq-demo
 * @BelongsPackage: com.example.esredisrabbitmqdemo.message
 * @Author: 江岸
 * @CreateTime: 2020-07-04 15:39
 * @Description: 消息生产者
 */
@Component
public class MessageProduct {
    @Autowired
    AmqpTemplate amqpTemplate;

    //生产消息-sava方法
    public void sent(String msg){
        amqpTemplate.convertAndSend("userId", msg );

    }
    //生成消息-delete方法
    public void sentDel(String msg){
        amqpTemplate.convertAndSend("userIdDel", msg );

    }
}
